<?php

namespace Fang\UserBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use Fang\UserBundle\Entity\User;
use Fang\UserBundle\Form\Register;

class LogregisterController extends Controller
{
	/**
	*主账户注册页面
	*@Route("/fuser/register", name="fregister")
	**/
	public function registerAction(Request $request)
	{
		$user = new User();
		$registerForm = $this->createForm(Register::class, $user);
     	//处理表单提交
		$registerForm->handleRequest($request);
		if($registerForm->isSubmitted() && $registerForm->isValid())
		{
			$user = $registerForm->getData();
			
			dump($user);
		}

		return $this->render("@FangUser/logregister/register.html.twig", array("registerForm"=>$registerForm->createView()));
	}
}
